home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 April / macformat-023.iso / Shareware in MacFormat / brailler0.5b / brlr ƒ / Shell ƒ / generic open.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-12-20  |  1.2 KB  |  62 lines  |  [TEXT/MMCC]

  1. #include "program globals.h"
  2. #include "generic open.h"
  3. #include "brlr load-save.h"
  4. #include "environment.h"
  5. #include "dialogs.h"
  6. #include "error.h"
  7. #include "print meat.h"
  8. #include "file utilities.h"
  9. #include "graphics.h"
  10. #include "window layer.h"
  11.  
  12. void OpenTheFile(FSSpec *myFSS)
  13. {
  14.     FSSpec                saveFile;
  15.     
  16.     switch (GetFileType(myFSS))
  17.     {
  18.         case SAVE_TYPE:
  19.             if (!IndWindowExistsQQ(kMainWindow))
  20.             {
  21.                 saveFile=*myFSS;
  22.                 GetTheFile(&saveFile);
  23.                 gNeedToOpenWindow=FALSE;
  24.             }
  25.             else
  26.             {
  27.                 RemoveHilitePatch();
  28.                 PositionDialog('ALRT', smallAlert);
  29.                 ParamText("\pPlease close the current text before opening another.","\p","\p","\p");
  30.                 StopAlert(smallAlert, 0L);
  31.                 InstallHilitePatch();
  32.             }
  33.             break;
  34.     }
  35. }
  36.  
  37. void PrintTheFile(FSSpec *myFSS)
  38. {
  39.     WindowPtr        theWindow;
  40.     
  41.     switch (GetFileType(myFSS))
  42.     {
  43.         case SAVE_TYPE:
  44.             if (!IndWindowExistsQQ(kMainWindow))
  45.             {
  46.                 GetTheFile(myFSS);
  47.                 theWindow=GetIndWindowPtr(kMainWindow);
  48.                 PrintText(GetWindowTE(theWindow));
  49.                 CloseTheWindow(theWindow);
  50.             }
  51.             else
  52.             {
  53.                 RemoveHilitePatch();
  54.                 PositionDialog('ALRT', smallAlert);
  55.                 ParamText("\pPlease close the current text before printing.","\p","\p","\p");
  56.                 StopAlert(smallAlert, 0L);
  57.                 InstallHilitePatch();
  58.             }
  59.             break;
  60.     }
  61. }
  62.